package com.laozj.test.controller;

import com.laozj.common.utils.R;
import com.laozj.test.entity.StudentEntity;
import com.laozj.test.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/stu")
public class StudentController {

    @Autowired
    StudentService studentService;

    @GetMapping("/list")
    public R list(){
        List<StudentEntity> entityList =  studentService.getStudentList();
        return R.ok("查找成功").setDate(entityList);
    }


}
